Skip to content

[WIP] Ship BR schema as standalone llmdbenchmark-schema package#1273

Draft
Bslabe123 wants to merge 1 commit into
llm-d:mainfrom
Bslabe123:wip/schema-subpackage
Draft

[WIP] Ship BR schema as standalone llmdbenchmark-schema package#1273
Bslabe123 wants to merge 1 commit into
llm-d:mainfrom
Bslabe123:wip/schema-subpackage

Conversation

@Bslabe123
Copy link
Copy Markdown

@Bslabe123 Bslabe123 commented May 15, 2026

Summary

Splits the Benchmark Report (BR) schema types out of the main llmdbenchmark distribution and into a separate pip-installable package, llmdbenchmark-schema, living in the same repo under llmdbenchmark-schema/.

External tools that produce or consume BR reports (workload generators like inference-perf, dashboards, analysis pipelines) currently have to either vendor the schema files or pull in the full llmdbenchmark package, which carries kubernetes, pykube-ng, kubernetes-asyncio, transformers, huggingface_hub, etc. Those deps are unrelated to the schema and don't belong in the dependency closure of a typed schema consumer.

After this change:

  • pip install llmdbenchmark-schema pulls in only pydantic>=2.0 and PyYAML.
  • pip install llmdbenchmark continues to work and re-exports the schema types under llmdbenchmark.analysis.benchmark_report, existing callers do not need to change.
  • Both distributions ship from the same repo, the same commit, the same maintainers, the same CI workflow.

Marked WIP because the publish workflow still needs to be updated to push both distributions from the same CI run (see open questions below). The code split itself is complete and locally verified.

Layout

llmdbenchmark-schema/
  pyproject.toml                            # name = "llmdbenchmark-schema"
  README.md
  llmdbenchmark_schema/
    __init__.py
    base.py                                 # moved from analysis/benchmark_report/
    schema_v0_1.py                          # moved
    schema_v0_2.py                          # moved
    schema_v0_2_components.py               # moved
    br_v0_1_example.yaml                    # moved
    br_v0_2_example.yaml                    # moved
    br_v0_1_json_schema.json                # moved
    br_v0_2_json_schema.json                # moved
    py.typed
llmdbenchmark/
  analysis/
    benchmark_report/
      __init__.py                           # re-exports from llmdbenchmark_schema
      cli.py, core.py, native_to_br0_*.py   # import from llmdbenchmark_schema
pyproject.toml                              # adds llmdbenchmark-schema as a dep

History is preserved via git mv so blame and per-file history follow the files to their new location.

Verified locally

  • pip install -e llmdbenchmark-schema/ succeeds.
  • from llmdbenchmark_schema import BenchmarkReportV02 works.
  • The vendored br_v0_2_example.yaml round-trips against BenchmarkReportV02.
  • All updated files under llmdbenchmark/analysis/benchmark_report/ compile cleanly with the new import paths.

Open questions for reviewers

  • Update the publish workflow to push both llmdbenchmark and llmdbenchmark-schema to PyPI from the same CI run.
  • Sweep the repo for any other places still doing relative imports of the moved files. I rewrote the ones I found in llmdbenchmark/analysis/benchmark_report/; happy to look at more if reviewers point them out.
  • Naming: llmdbenchmark-schema (PyPI name) and llmdbenchmark_schema (Python package). Open to bikeshed.

Motivation

kubernetes-sigs/inference-perf#461 currently vendors ~1,300 lines of the BR0.2 schema from this repo because there's no other way to consume the types. With this change, that PR can replace the vendored files with llmdbenchmark-schema as a pip dependency.

Filing this WIP as a starting point for discussion; happy to iterate on the structure, naming, or split boundary.

The Benchmark Report (BR) schema types are useful to external workload
generators that produce BR reports (e.g. inference-perf) and to external
analysis pipelines that consume them. Today, taking a dependency on these
types means depending on the full llmdbenchmark distribution, which pulls
in kubernetes/transformers/huggingface_hub/etc. External tools typically
have none of these in their dependency closure, so they either vendor the
schema files or skip the typed API entirely.

This change splits the schema into its own pip-installable distribution
(llmdbenchmark-schema) sitting in the same repo, with the same maintainers,
published from the same CI workflow. The full llmdbenchmark package depends
on it and re-exports the types under llmdbenchmark.analysis.benchmark_report
so existing callers do not need to change.

Layout:

  llmdbenchmark-schema/
    pyproject.toml                            (name = "llmdbenchmark-schema")
    llmdbenchmark_schema/
      __init__.py
      base.py                                 (moved from analysis/benchmark_report/)
      schema_v0_1.py                          (moved)
      schema_v0_2.py                          (moved)
      schema_v0_2_components.py               (moved)
      br_v0_*_example.yaml                    (moved)
      br_v0_*_json_schema.json                (moved)
      py.typed
    README.md
  llmdbenchmark/
    analysis/
      benchmark_report/
        __init__.py                           (re-exports from llmdbenchmark_schema)
        cli.py, core.py, native_to_br0_*.py   (import from llmdbenchmark_schema)
  pyproject.toml                              (adds llmdbenchmark-schema as a dep)

Runtime deps for llmdbenchmark-schema: pydantic>=2.0, PyYAML.

Verified locally:
  - pip install -e llmdbenchmark-schema/ succeeds
  - from llmdbenchmark_schema import BenchmarkReportV02 works
  - br_v0_2_example.yaml round-trips against the schema
  - All updated files under llmdbenchmark/analysis/benchmark_report/ compile

Open questions / WIP items:
  - Wire the publish workflow to ship both distributions from the same CI run.
  - Version policy: llmdbenchmark-schema is set to 0.2.0 (tracks the latest
    BR schema version it ships). Should it follow llmdbenchmark's versioning
    instead?
  - Sweep for any other places in the repo still doing relative imports of
    the moved files.

Motivation for inference-perf:
  kubernetes-sigs/inference-perf#461
  inference-perf currently vendors ~1300 lines of the BR0.2 schema; this
  change would let it depend on llmdbenchmark-schema instead.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant